package com.sky.mapper;

import com.sky.entity.ShoppingCart;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface ShoppingCartMapper {




    List<ShoppingCart> listShoppingCart(ShoppingCart shoppingCart);


    void updateShoppingCart(ShoppingCart cart);


    void insertShoppingCart(ShoppingCart shoppingCart);


    @Delete("delete from shopping_cart where user_id = #{userId}")
    void cleanShoppingCart(ShoppingCart shoppingCart);


    @Delete("delete from shopping_cart where user_id = #{userId} and id = #{id}")
    void subShoppingCart(ShoppingCart shoppingCart);

    void insertBatch(List<ShoppingCart> shoppingCartList);
}
